1. Field of the Invention
This invention relates to apparatus for computing transcandental functions quickly.
2. Description of Related Art
Computing transcendental functions by Taylor series generally requires one xe2x80x9caddxe2x80x9d instruction (which might take, for example, three clock and one xe2x80x9cmultiplyxe2x80x9d instruction (which might also take, for example, three more clock times) for each term. For processors computing transendental functions to significant accuracy, it requires a number of terms to achieve a residual error less than the least significant bit of the answer. In a processor providing a floating point result having a 64-bit fraction, the number of terms is about ten for achieving 64-bit accuracy for the full range of an ordinary Taylor series; if multiply and add operations each take about three clock times, this would take about sixty clock times, which can be a significant amount of time when computation resources are at a premium. To obtain greater accuracy, even more terms and thus even more time would be required.
Accordingly, it would be advantageous to provide a tecnique for computing transcendental functions quickly. This advantage is achieved by apparatus according to the present invention in which terms of a Taylor series are computed in parallel and combined after parallel computation, so as to take only about one sixth of the xe2x80x9cnaturalxe2x80x9d amount of time per term.
The invention provides a method and system for computing transcendental functions quickly. In a preferred embodiment, (1) the multiply ALU is enhanced to include the operation of adding a term to the product, (2) rounding operations for intermediate multiply and add operations are skipped, (3) the Taylor series for the transcendental function is separated into two partial series which are performed in parallel, and (4) subtraction and recipricoals, if any, are reserved for the end of the computation. Where appropriate, an alternative Taylor series is used for faster convergence for part of the range of the transcendental function. Thereby, transcendental functions computed using a series with multiple terms (for example, SIN, COS, TAN, ARC TAN, EXP, or LOG), are thus performed in about one sixth of the xe2x80x9cnaturalxe2x80x9d amount of time per term, or about one clock time per term in processors in which multiply and add operations each take about three clock times each.